banner
Working With Lists - Continued

OPENING QUESTIONS:

Please take a few moments to complete this pre-quiz. This is a pre-test/formative assessment which means that it will go in the grade book but it won't count towards your grade.

 

LEARNING TARGET: I will be able to:

  • Explain the concept of a "list" in a programming context
  • Write a basic program to add items to a list

WORK O' THE DAY:

We talked a bit yesterday about that kind of odd: "Find First Item In" block. I asked you to take a look at that last night and find a use for that.

What did you find?

Please discuss (oh and "I tried to find it but I couldn't find anything" ain't really an answer that will fly)

Make a brief program 'snippet' to use that block. (It turns out it is pretty specialized, but there is still a lot of benefit from finding out how to use a weird command in programming-- get used to doing that!)

═══════════════════════════

Take a re-look at this program:

I had you do a line-by-line analysis of that code in our opener, please do that again with your team now.

In particular, notice the important of the 'index' (???)

Let's discuss!

  • Have a conversation with your team about how you can change that code to:
    • Ask the user to input a planet name
    • Check to see if that planet already exists in the list (senseis only)
    • Add that planet to the list
  • If time permits, start working on adding a brief menu to your program that asks the user whether they want to add an item from the list, delete an item from the list or search for an item in the list
  • Begin implementing that code!